/**
 * @Title: MathUtils.java
 * @Package com.sunbeam.common.utils
 * @Description: TODO
 * @author AromaSunbeam lyzpoq_gmail_com
 * @date 2013-8-31 下午10:29:26
 * @version V1.0
 */

package com.sunbeam.common.utils;

/**
 * @ClassName: MathUtils
 * @Description: TODO
 * @author AromaSunbeam lyzpoq_gmail_com
 * @date 2013-8-31 下午10:29:26
 *
 */
public class MathUtils {

	//*******************************TestMain**************************************
	/**
	 * @Title: main
	 * @Description: TODO
	 * @param @param args
	 * @return void
	 * @throws
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
        System.out.println(GetIndices(10,1000));
	}
	//*******************************TestMain**************************************
	
	/**
	 * 
	 * @Title: GetIndices
	 * @Description: e.g. baseNumber^n+a=value,then n=GetIndices(baseNumber,value);
	 * @param @param baseNumber
	 * @param @param value
	 * @param @return
	 * @return int
	 * @throws
	 */
	public static int GetIndices(int baseNumber,int value){
		int i=0;
		double temp=baseNumber;
		while(temp<=value){
			i++;
			temp*=baseNumber;
		}
		return i;
	}

}

